package com.ruoyi.project.system.state.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.state.mapper.DataStateMapper;
import com.ruoyi.project.system.state.domain.DataState;
import com.ruoyi.project.system.state.service.IDataStateService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 数据状态Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-20
 */
@Service
public class DataStateServiceImpl implements IDataStateService 
{
    @Autowired
    private DataStateMapper dataStateMapper;

    @Override
    public List<DataState> selectDataStateCreateTime(Date createTime) {
        return dataStateMapper.selectDataStateCreateTime(createTime);
    }

    /**
     * 查询数据状态
     * 
     * @param id 数据状态主键
     * @return 数据状态
     */
    @Override
    public DataState selectDataStateById(Long id)
    {
        return dataStateMapper.selectDataStateById(id);
    }

    /**
     * 查询数据状态列表
     * 
     * @param dataState 数据状态
     * @return 数据状态
     */
    @Override
    public List<DataState> selectDataStateList(DataState dataState)
    {
        return dataStateMapper.selectDataStateList(dataState);
    }

    /**
     * 新增数据状态
     * 
     * @param dataState 数据状态
     * @return 结果
     */
    @Override
    public int insertDataState(DataState dataState)
    {
        dataState.setCreateTime(DateUtils.getNowDate());
        return dataStateMapper.insertDataState(dataState);
    }

    /**
     * 修改数据状态
     * 
     * @param dataState 数据状态
     * @return 结果
     */
    @Override
    public int updateDataState(DataState dataState)
    {
        return dataStateMapper.updateDataState(dataState);
    }

    /**
     * 批量删除数据状态
     * 
     * @param ids 需要删除的数据状态主键
     * @return 结果
     */
    @Override
    public int deleteDataStateByIds(String ids)
    {
        return dataStateMapper.deleteDataStateByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除数据状态信息
     * 
     * @param id 数据状态主键
     * @return 结果
     */
    @Override
    public int deleteDataStateById(Long id)
    {
        return dataStateMapper.deleteDataStateById(id);
    }
}
